#include "StdAfx.h"
#include "Setting.h"

CSetting::CSetting(LPCTSTR sSection)
{
	this->sSection = sSection;
	CString sIni = theApp.sAppPath + L"Data\\settings.ini";
	ini.SetIniFileName(sIni);
}

CSetting::~CSetting(void)
{
}

int CSetting::GetInt(LPCTSTR sKey, int iDefault) {
	return ini.GetInt(sSection, sKey, iDefault);
}

int CSetting::SetInt(LPCTSTR sKey, int iValue) {
	return ini.WriteNumber(sSection, sKey, iValue);
}

int CSetting::GetString(LPCTSTR sKey, CString* cRet, LPCTSTR sDefault) {
	return ini.GetString(sSection, sKey, *cRet, sDefault);
}

int CSetting::SetString(LPCTSTR sKey, LPCTSTR sValue) {
	return ini.WriteString(sSection, sKey, sValue);
}